package com.xyg.sample.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import com.xyg.sample.model.Student;
import com.xyg.sample.model.Student.Gender;

public interface StudentDao extends PagingAndSortingRepository<Student, Long> {
	
	Page<Student> findByGender(Gender gender,Pageable pageable);
	
	@Query("select s from Student s where s.gender = :gender")
	Page<Student> find(@Param(value = "gender")Gender gender,Pageable pageable);
	
	

}
